package com.itnoob.base.decoratorclass;

import com.itnoob.base.coffee.Drink;

/**
 * 装饰类:接收一个基类,装饰类装饰基类
 * coffee
 */
public class Decorator extends Drink {
    private Drink obj;
    public Decorator(Drink obj){
        this.obj=obj;
    }

    @Override
    public float cost() {
        return super.getPrice()+obj.cost();
    }
    public String getDes(){
        return super.des+" "+super.getPrice()+"&&"+obj.getDes();
    }
}
//调味品




